A 12" schedule 40 steel pipe is 60 feet long; it serves to connect water from a reservoir to the atmosphere. The water is 60 deg F and the elevation distance of the pipe is 12 feet.
The pipe also contains a gate valve 10' from the entrance. The entrance into the reservoir is at a distance from the wall.
Find the diameter of a standard orifice plate to make the flow velocity exactly 10 ft/s.
In [117]:
from fluids.units import *
from fluids.constants import g
from math import pi
from scipy.optimize import newton
g = g*u.m/u.s**2
dH = 12*u.foot
L = (60)*u.foot
mu = 1.1*u.cP
rho = 62.364*u.lb/u.ft**3
NPS, Di, Do, t = nearest_pipe(Do=12*u.inch, schedule='40')
v = 10*u.foot/u.s
A = 0.25*pi*Di**2
m = v*A*rho
Re = rho*v*Di/mu
# Approximately match their friction factor, roughness not specified
fd = friction_factor(Re=Re, eD=0.0006*u.inch/Di)
ft = ft_Crane(Di) # Not needed
K_entrance = entrance_distance(Di=Di, method='Crane')
K_exit = exit_normal()
K_gate = K_gate_valve_Crane(D1=Di, D2=Di, angle=0.0*u.degrees)
K_tot = K_entrance + K_exit + K_gate
K_tot += K_from_f(fd=fd, L=L, D=Di)
dP = dP_from_K(K=K_tot, rho=rho, V=v)
k = 1.33
dP_gravity = rho*g*dH
dP_meter = dP_gravity - dP
meter_type = 'ISO 5167 orifice'
orifice_taps = 'corner'
# P2 is assumed - does have an impact but it is minimal
P2 = 1e6*u.Pa
P1 = (P2 + dP_meter*2.5)
print('Numerical solver progress:')
def to_solve(beta):
# Do not know orifice measured dP or C, only actual dP
D2 = Di*beta
# Solve for upstream pressure given actual flow rate and guessed diameter
P1 = differential_pressure_meter_solver(Di, rho, mu, k, D2=D2, P2=P2,
m=m, meter_type=meter_type,
taps=orifice_taps)
# Calculate `C`
C, expansibility = differential_pressure_meter_C_epsilon(Di, D2, m, P1, P2, rho, mu, k,
meter_type=meter_type, taps=orifice_taps)
# Caclulate what the guessed orifice actual dP is
calc_dP = dP_orifice(D=Di, Do=D2, P1=P1, P2=P2, C=C)
err = (calc_dP - dP_meter).to_base_units()
print(err.magnitude, beta, C.magnitude)
return err.magnitude
beta = newton(to_solve, .5, tol=1e-13)
print('Size is:')
print((Di*beta).to(u.inch))
The answer given in Crane is 7.94 inches, but only three iterations are performed there.